package com.rwy.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import com.rwy.dto.RespItemDTO;
import com.rwy.dto.StatisticDeviceDTO;
import com.rwy.dto.StatisticsSummaryDTO;

@Mapper
public interface StatisticsDaoMapper {

	@SelectProvider(type=StatisticsProvider.class, method="getStatisticSummaryData")
	public StatisticsSummaryDTO getStatisticSummaryData(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
	
	@SelectProvider(type=StatisticsProvider.class, method="getPrintKindSummary")
	public List<StatisticsSummaryDTO> getPrintKindSummary(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime);
	
	@SelectProvider(type=StatisticsProvider.class, method="getPrintKindStatistic")
	public List<StatisticsSummaryDTO> getPrintKindStatistic(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("kindID") Integer kindType, @Param("recordSt") Integer recordSt);
	
	@SelectProvider(type=StatisticsProvider.class, method="getTroubleTerminalStatistic")
	public List<StatisticsSummaryDTO> getTroubleTerminalStatistic(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("terminalSt") Integer terminalSt);

	@SelectProvider(type=StatisticsProvider.class, method="getDevicePrintRecordStatistic")
	public List<StatisticDeviceDTO> getDevicePrintRecordStatistic(@Param("partnerIds")List<Integer> partnerIds,@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("terminalS") List<StatisticDeviceDTO> terminalList);
	
	@SelectProvider(type=StatisticsProvider.class, method="getOrderRefundItem")
	public List<StatisticsSummaryDTO> getOrderRefundItem(@Param("partnerIds")List<Integer> partnerIds,@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	@SelectProvider(type=StatisticsProvider.class, method="getTerminalTotal")
	public Integer getTerminalTotal(@Param("partnerIds")List<Integer> partnerIds);
	
	@SelectProvider(type=StatisticsProvider.class, method="getTerminalSort")
	public List<StatisticDeviceDTO> getTerminalPage(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("page")Integer page, @Param("pageSize") Integer pageSize);
	
	@SelectProvider(type=StatisticsProvider.class, method="getDeviceRecordByPrintKind")
	public List<RespItemDTO> getDeviceRecordByPrintKind(@Param("partnerIds")List<Integer> partnerIds , @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("terminalID") Integer terminalID, @Param("printKind") Integer printKind);
	
	
	@SelectProvider(type=StatisticsProvider.class, method="getOrderRecord")
	public List<StatisticsSummaryDTO> getOrderRecord(@Param("partnerIds")List<Integer> partnerIds,@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	
	//sales network report
	@SelectProvider(type=StatisticsProvider.class, method="getSaleNetworkTotal")
	public Integer getSaleNetworkTotal(@Param("partnerIds")List<Integer> partnerIds);
	
	@SelectProvider(type=StatisticsProvider.class, method="getSaleNetworkStatisticPage")
	public List<StatisticDeviceDTO> getSaleNetworkStatisticPage(@Param("partnerIds")List<Integer> partnerIds, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("page")Integer page, @Param("pageSize") Integer pageSize);
	
	@SelectProvider(type=StatisticsProvider.class, method="getSaleNetworkRecordStatistic")
	public List<StatisticDeviceDTO> getSaleNetworkRecordStatistic(@Param("partnerIds")List<Integer> partnerIds,@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("saleNetworkIDs") List<StatisticDeviceDTO> salenetworkIds);
 
	@SelectProvider(type=StatisticsProvider.class, method="getSalsNetworkRecordByPrintKind")
	public List<RespItemDTO> getSalesNetworkRecordByPrintKind(@Param("partnerIds")List<Integer> partnerIds , @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("terminalID") Integer terminalID, @Param("printKind") Integer printKind);
	
}
